package com.example.crmweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.crmweb.entity.StaffBranch;
import com.example.crmweb.mapper.StaffBranchMapper;
import com.example.crmweb.service.StaffBranchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author -CRM-
 * @since 2022-03-18
 */
@Service
public class StaffBranchServiceImpl extends ServiceImpl<StaffBranchMapper, StaffBranch> implements StaffBranchService {
    @Autowired
    private StaffBranchMapper staffBranchMapper;

    @Override
    @Transactional(rollbackFor = {RuntimeException.class, Error.class})
    public Integer createStaffBranch(StaffBranch staffBranch) {
        int res = staffBranchMapper.insert(staffBranch);
        if(staffBranch.getStaffId()==null || staffBranch.getBranchId()==null){

        }
        return res;
    }
}
